//
//  loadView.m
//  Auditory
//
//  Created by 寒竹子 on 15/4/30.
//  Copyright (c) 2015年 寒竹子. All rights reserved.
//

#import "loadView.h"

@implementation loadView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setup];
    }
    
    return self;
}

// 初始化
- (void)setup
{
    self.text = @"正在加载更多数据";
    self.font = TextFont(15.0f);
    self.textColor = [UIColor whiteColor];
    self.clipsToBounds = YES;
    self.layer.cornerRadius = 2.0f;
    self.textAlignment = NSTextAlignmentCenter;
    self.backgroundColor = [UIColor blackColor];
    self.alpha = .9f;
}

// 添加到window上
- (void)display
{
    [[UIApplication sharedApplication].keyWindow addSubview:self];
}

// 移除
- (void)hidden
{
    [self removeFromSuperview];
}

@end
